package com.wis.traffic.common.prop;


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropUtil {
	// 日志
//	private static Logger _log = LoggerFactory.getLogger(PropUtil.class);
	
	private static Properties prop ;
	
	static {
		prop = new Properties();
		try {
			InputStream is = null ; 
			//is = PropUtil.class.getResourceAsStream("config.ini");
			is = new FileInputStream("config.ini"); 
			prop.load(is); 
			is.close(); 
		} catch (FileNotFoundException e) {
//			_log.error(e.getMessage());
		} catch (IOException e) {
//			_log.error(e.getMessage());
		}
	}
	
	public static String get(String key ) {
		String res = (String) prop.get(key);
		if ( null != res )
			res = res.trim() ;
		return res ;
	}

	public static Properties getAll() {
		return prop ;
	}
}
